url = "/account/dashboard.html"
title = "account/dashboard"
description = "用户中心首页"
layout='default'  

[session]
security = "user"
redirect = "account/login"
==
{% put page_title %}{{ 'Register customer'|_ }} - {% default %}{% endput %}
{% set shoppingCart = catalog.getShoppingCart %}
{% set historys = catalog.fetchProductViewHistories %}
{% set wishlists = catalog.getWishlists %}

<link href="{{ 'assets/css/mypage.css'|theme }}" rel="stylesheet" type="text/css" />
<!-- contents -->
<div id="contents">
	<nav class="crumbs_nav">
		<ul class="crumbs_list rdstr">
			<li class="crumbs_item">
				<a class="crumbs_link" href="/">
					<span>{{ 'Home'|_ }}</span>
				</a>
			</li>
			<li class="crumbs_item no_deco">
				<span class="crumbs_link">{{ 'My account'|_ }}</span>
			</li>
		</ul>
	</nav>
	<div class="clearfix ph10 pv5">
		<h3 class="fwb fnt_defalut">{{ 'Hi'|_ }}, {{ user.name }}</h3>
        <p>
            {{ "Welcome shopping in http://igadgea.com/ ,it’s online Corner for Modern, Irresistible, and Affordable men’s clothing. Including selection of polo shirts, jeans , shorts, accessories, and shoes at the web’s best prices."|_ }}
        </p>
	</div>
	<nav class="mypage_menuNavi mb20">
		<div class="mypage_menuNavi_line combine">
			<a class="mypage_menuNavi_item" href="{{ 'account/wishlist'|page }}">
				<div class="mypage_menuNavi_icon">
					<span class="sprite-mypage3 sprite-mypage3_heart"></span>
				</div>
				<div class="mypage_menuNavi_text">{{ 'Wishlist'|_ }}</div>
				<span class="dashboard_num">{{ count(wishlists) }}</span>
			</a>
			<a class="mypage_menuNavi_item" href="{{ 'account/orders'|page }}">
				<div class="mypage_menuNavi_icon">
					<span class="sprite-mypage3 sprite-mypage3_orderHistory"></span>
				</div>
				<div class="mypage_menuNavi_text">{{ 'My order'|_ }}</div>
			</a>
			<a class="mypage_menuNavi_item" href="{{ 'common/faq'|page }}">
				<div class="mypage_menuNavi_icon">
					<span class="sprite-mypage3 sprite-mypage3_help"></span>
				</div>
				<div class="mypage_menuNavi_text">{{ 'FAQ'|_ }}</div>
			</a>
		</div>
		<div class="mypage_menuNavi_line">
			<a class="mypage_menuNavi_item" href="{{ 'account/billing-address'|page }}">
				<div class="mypage_menuNavi_icon">
					<span class="sprite-mypage3 sprite-mypage3_sainyuuka"></span>
				</div>
				<div class="mypage_menuNavi_text">{{ 'Address'|_ }}</div>
			</a>
			<a class="mypage_menuNavi_item" href="{{'account/profile'|page }}">
				<div class="mypage_menuNavi_icon">
					<span class="sprite-mypage3 sprite-mypage3_review"></span>
				</div>
				<div class="mypage_menuNavi_text">{{ 'Change to login'|_ }}</div>
			</a>
			<a class="mypage_menuNavi_item" href="javascript:;" data-request="onLogout" data-request-data="redirect: '/'">
				<div class="mypage_menuNavi_icon">
					<span class="sprite-mypage3 sprite-mypage3_member"></span>
				</div>
				<div class="mypage_menuNavi_text">{{ 'LOG OUT'|_ }}</div>
			</a>
		</div>
	</nav>
<section>
	<h3 class="title_main">{{ 'History'|_ }}</h3>
	<ul class="list_product_box clearfix">
		{% for key, historyProduct in historys %}
                           {% if key<= 8 %}
		<li class="list_product_item">
			<div class="box_list list_product_item_inner">
				<a class="list_product_link box_list_main" href="{{ historyProduct.url }}">
					<div class="list_product_frame">
						<div class="list_product_img_block">
							<img class="productImgH" src="{{ historyProduct.getMainThumb(160,160) }}">
						</div>
						<div class="list_product_text_block mb5">
							<p class="list_product_brand rdstr">{{ historyProduct.name }}</p>
							<p class="list_product_category rdstr">
								{% if historyProduct.status=="instock" %}
                                    {{ 'In stock'|_ }}
                                {% else %}
                                    {{ 'Out of stock'|_ }}
                                {% endif %}
							</p>
							<p class="list_product_price_block rdstr pricedownView list_product_box">
								<span class="list_product_price force_color">{{ historyProduct.price|formatPrice }}</span>
								<span class="old-price">{{ historyProduct.list_price|formatPrice }}</span>

							</p>
						</div>
						<span class="arrow"></span>
					</div>
				</a>
			</div>
		</li>
		{% endif %}
		{% endfor %}
	</ul>
	<a class="coreMore" href="{{ 'account/history'|page }}">
		<div class="coreMore_textWrap">
			{{ 'View history'|_ }}
			<span class="coreMore_icon arrow"></span>
		</div>
	</a>
</section>
{% partial 'info-email' %}
</div>
<!-- end contents -->